package practice;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        Set<Character> set = new HashSet<>();
        //Map<Character,Integer> map = new TreeMap<>();
        char[] chars = new char[52];
        int[] times = new int[52];
        int index = 0;
        int count;
        for(int i=0;i<s.length();i++){
            count = 0;
            if(!set.contains(s.charAt(i))){
                set.add(s.charAt(i));
                for(int j=i;j<s.length();j++){
                    if(s.charAt(j) == s.charAt(i)){
                        count++;
                    }
                }
                //map.put(s.charAt(i),count);
                chars[index] = s.charAt(i);
                times[index] = count;
                index++;
            }
        }
        //map.forEach((k,v) -> System.out.print(k+":"+v+";"));
        int pos;
        int temp;
        char tempchar;
        for(int i=0;i<index;i++){
            pos = i;
            for(int j=i+1;j<index;j++){
                if(times[pos] < times[j]){
                    pos = j;
                }
                if(times[pos] == times[j]){
                    if(chars[pos] > chars[j]){
                        pos = j;
                    }
                }
            }
            if(pos != i){
                temp = times[i];
                times[i] = times[pos];
                times[pos] = temp;
                tempchar = chars[i];
                chars[i] = chars[pos];
                chars[pos] = tempchar;
            }
        }
        for(int i=0;i<index;i++){
            System.out.print(chars[i]+":"+times[i]+";");
        }
    }
}